import java.util.Timer;
import java.util.concurrent.*;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-10-03
 * Time: 20:40
 */
public class Test5 {
    public static void main(String[] args) {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 10, 1000,
                TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(100), Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.DiscardPolicy());
        int i = 0;
        for(i = 0; i < 100; i++){
            threadPoolExecutor.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("hello world");//
                }
            });
        }
        System.out.println(i);
    }
}
